<%@include file="/jsp/taglib.jspf"%>
<%@include file="/jsp/constant.jspf"%>
<hunk:container>
    <table class="hundred">
        <c:forEach var="charge" items="${purchaseForm.purchase.charges}" varStatus="status">
            <tr>
                <td>
                    <c:set value="${container.charges}" var="charges" scope="session"/>
                    <hunk:select name="purchase.charges[${status.count-1}].charge.id" collections="charges"  indexProperty="id" valueProperty="description"/>
                    
                </td>
                <td>
                    <hunk:text name="purchase.charges[${status.count-1}].amount" styleClass="required" container="NULL" label="Rate"/>
                </td>
                <td>
                    <hunk:link href="${path}/purchase.do?action=removeCharge&index=${status.count-1}">remove</hunk:link>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td>
                <hunk:button label="Add Charge" onclick="window.location='${path}/purchase.do?action=addCharge';"/>
            </td>
        </tr>
    </table>
</hunk:container>